-
-
Notifications
You must be signed in to change notification settings - Fork 87
ntf server: webpush requests #1642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unified-push
Are you sure you want to change the base?
Conversation
…1gp1g-webpush_requests
|
@p1gp1g please see the last commit and lets talk |
* Parse WPDeviceToken during registration * Clarify PPInvalidPusher with apnsPushProviderClient * Use SrvLoc for webpush endpoints * Remove unused WPEndpoint * Test RFC8291 - webpush encryption - implementation * Fix tests with -fserver_postgres * Disable redirections with webpush * Rename webpush tests, and move behind server_postgres flag * Parse webpush endpoint with StrEncoding * Fix rename webpush tests * Lint import * Test push notification encoding for webpush * Test strDecoding invalid WPDeviceToken
e21323a to
98280e2
Compare
98280e2 to
e3f8937
Compare
| _ -> PPWPOtherError $ tshow e | ||
| where | ||
| fromStatusCode status reason | ||
| | status == N.status200 = PPWPRemovedEndpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace with 404?
|
|
||
| -- | encrypt :: UA key -> AS key -> salt -> clear -> cipher | ||
| -- | https://www.rfc-editor.org/rfc/rfc8291#section-3.4 | ||
| wpEncrypt' :: WPKey -> ECC.PrivateNumber -> ByteString -> ByteString -> ExceptT C.CryptoError IO ByteString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add symmetric decrypt function and test
| ivFrom :: ByteString -> ExceptT C.CryptoError IO C.GCMIV | ||
| ivFrom s = liftEither $ C.gcmIV s | ||
|
|
||
| encodeWPN :: PushNotification -> BL.ByteString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add symmetric decodeWPN
| shift i w = Bits.shiftL (fromIntegral w) (64 * i) | ||
|
|
||
| data WPTokenParams = WPTokenParams | ||
| { wpPath :: ByteString, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace with relative URI as discussed
| PPAPNS p -> APNSDeviceToken p . encodeUtf8 <$> (o .: "token") | ||
|
|
||
| -- | Returns fields for the device token (pushProvider, token) | ||
| -- TODO [webpush] save token as separate fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
different fields for different token subtypes, same for deviceTokenFields.
see comments in #1613